using System;
using Betfair.Api.Types;
using Newtonsoft.Json;

namespace Betfair.Api
{
    public sealed class Order
    {
        public Order(string id, OrderType type, OrderStatus status, PersistanceType persistance, Side side, double price,
            double size, double bsp, DateTime placed, double avgpriceMatched, double sizeMatched, double sizeRemaining,
            double sizeLapsed, double sizeCancelled, double sizeVoided)
        {
            Id = id;
            Type = type;
            Status = status;
            Persistance = persistance;
            Side = side;
            Price = price;
            Size = size;
            Bsp = bsp;
            Placed = placed;
            AvgpriceMatched = avgpriceMatched;
            SizeMatched = sizeMatched;
            SizeRemaining = sizeRemaining;
            SizeLapsed = sizeLapsed;
            SizeCancelled = sizeCancelled;
            SizeVoided = sizeVoided;
        }

        [JsonProperty("orderId")]
        public string Id { get; private set; }

        [JsonProperty("orderType")]
        public OrderType Type { get; private set; }

        [JsonProperty("orderStatus")]
        public OrderStatus Status { get; private set; }

        [JsonProperty("persistenceType")]
        public PersistanceType Persistance { get; private set; }

        [JsonProperty("side")]
        public Side Side { get; private set; }

        [JsonProperty("price")]
        public double Price { get; private set; }

        [JsonProperty("size")]
        public double Size { get; private set; }

        [JsonProperty("bspLiability")]
        public double Bsp { get; private set; }

        [JsonProperty("placedDate")]
        public DateTime Placed { get; private set; }

        [JsonProperty("avgPriceMatched")]
        public double AvgpriceMatched { get; private set; }

        [JsonProperty("sizeMatched")]
        public double SizeMatched { get; private set; }

        [JsonProperty("sizeRemaining")]
        public double SizeRemaining { get; private set; }

        [JsonProperty("sizeLapsed")]
        public double SizeLapsed { get; private set; }

        [JsonProperty("sizeCancelled")]
        public double SizeCancelled { get; private set; }

        [JsonProperty("sizeVoided")]
        public double SizeVoided { get; private set; }
    }
}